package com.xix.canal.client.writer.mysql.support;

import com.xixi.canal.client.support.Dml;

import java.util.LinkedHashMap;
import java.util.Map;

public class SingleDml {

    private String destination;
    private String database;
    private String table;
    private String eventType;
    private Map<String, Dml.ColumnData> columnData;

    public String getDestination() {
        return destination;
    }

    public void setDestination(String destination) {
        this.destination = destination;
    }

    public String getDatabase() {
        return database;
    }

    public void setDatabase(String database) {
        this.database = database;
    }

    public String getTable() {
        return table;
    }

    public void setTable(String table) {
        this.table = table;
    }

    public String getEventType() {
        return eventType;
    }

    public void setEventType(String eventType) {
        this.eventType = eventType;
    }

    public Map<String, Dml.ColumnData> getColumnData() {
        return columnData;
    }

    public void setColumnData(Map<String, Dml.ColumnData> columnData) {
        this.columnData = columnData;
    }

    public void addColumn(String name, Dml.ColumnData column) {
        if (this.columnData == null) this.columnData = new LinkedHashMap<>();
        this.columnData.put(name, column);
    }
}
